﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SilverlightControlToolkit._noScriptSharp._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Silverlight.js" />
            <asp:ScriptReference Path="~/aaagctrl.debug.js" />
            <asp:ScriptReference Path="~/SilverlightControlToolkit.debug.js" />
            <asp:ScriptReference Path="~/MySLManager.js" />
        </Scripts>
    </asp:ScriptManager>
    <script type="text/javascript">
       Sys.Application.add_init(function()
       {
            $create(MySLManager,{width : 600, height:512, xamlPath:"Page.xaml"},null,null, $get("host"));
       });
       function onSetSizeClicked()
       {
        try
        {
            var stackPanel = $find("StackPanelTest");
            var txtBox = $get("txtSize");
            var newValue = parseFloat(txtBox.value);
            if(newValue != NaN)
            {
                stackPanel.set_width(newValue);
            }
            
        }
        catch($e)
        {
            Sys.Debug.trace("stackPanel.set_width failed");
        }
       }
    </script>
    <div id="host">
        
    </div>
    <div id="htmlControls">
        <input type="text" id="txtSize" /> <input type="button" id="btnSize" value="Set Stackpanel width" onclick="onSetSizeClicked()"/>
    </div>
    </form>
</body>
</html>
